package com.ruoyi.project.module.ossConfigLog.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.web.domain.BaseEntity;

import java.nio.charset.StandardCharsets;
import java.util.Date;

/**
 * 阿里云OSS资源更新日志表 oss_config_log
 * 
 * @author ruoyi
 * @date 2019-04-08
 */
public class OssConfigLog extends BaseEntity
{
	private static final long serialVersionUID = 1L;
	
	/** 主键 */
	private Integer ossConfigLogId;
	/** 阿里云OSS资源ID */
	private Integer ossConfigId;
	/**  */
	private Date addtime;
	/** 内容 */
	private byte[] fileContent;

	private String fileContentStr;

	public void setOssConfigLogId(Integer ossConfigLogId) 
	{
		this.ossConfigLogId = ossConfigLogId;
	}

	public Integer getOssConfigLogId() 
	{
		return ossConfigLogId;
	}
	public void setOssConfigId(Integer ossConfigId) 
	{
		this.ossConfigId = ossConfigId;
	}

	public Integer getOssConfigId() 
	{
		return ossConfigId;
	}
	public void setAddtime(Date addtime) 
	{
		this.addtime = addtime;
	}

	public Date getAddtime() 
	{
		return addtime;
	}



    @Override
	public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("ossConfigLogId", getOssConfigLogId())
            .append("ossConfigId", getOssConfigId())
            .append("addtime", getAddtime())
            .append("fileContent", getFileContent())
            .toString();
    }

	public byte[] getFileContent() {
		return fileContent;
	}

	public void setFileContent(byte[] fileContent) {
		this.fileContent = fileContent;
	}
	public String getFileContentStr(){
		if(this.fileContent==null){
			return null;
		}

		return new String(this.fileContent, StandardCharsets.UTF_8);
	}

	public void setFileContentStr(String fileContentStr) {
		if(fileContentStr!=null){
			this.fileContent=fileContentStr.getBytes(StandardCharsets.UTF_8);
		}else {
			this.fileContent=null;
		}
	}
}
